package cn.bluethink.zentao.entity;

import java.io.Serializable;

import cn.bluethink.zentao.model.ZtProjectStatistics;
import cn.bluethink.zentao.model.ZtStatistics;

/**
 * 禅道统计列表实体类
 * 
 * @title 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.1.0
 * @describe 
 * @author fanBl
 * @date  2018年12月12日
 */
public class ZtStatisticsEntity implements Serializable {
	
	private static final long serialVersionUID = -3312279878263187825L;

	/**
	 * 禅道任务Id
	 */
	private Long tid;

	/**
	 * 禅道任务编码
	 */
	private Integer taskNum;

	/**
	 * 禅道项目Id
	 */
	private Integer project;

	/**
	 * 禅道任务被指派人Id
	 */
	private Integer uid;
	
	/**
	 * 禅道任务被指派人名称
	 */
	private String uname;
	
	/**
	 * 用户完成的总任务个数
	 */
	private Double zanTaoDoneTask;
	
	/**
	 * 指派给用户的总任务个数
	 */
	private Double zanTaoCountTask;
	
	/**
	 * 用户延误的总任务个数
	 */
	private Double zanTaoDelayTask;
	
	/**
	 * 用户  预计总工时
	 */
	private Double estimated;

	/**
	 * 用户 消耗总工时
	 */
	private Double depletion;

	/**
	 * 任务完成率
	 */
	private String finishRate;

	/**
	 * 任务延误率
	 */
	private String delayRate;

	/**
	 * 用户工作负载
	 */
	private String workload;

	/**
	 * 消耗比
	 */
	private String depletionRate;

	/**
	 * 饱满度
	 */
	private String plumpness;
	
	/**
	 * 固定工时
	 */
	private Double fixed = 40.0;
	
	/**
	 * 项目中的员工
	 */
    private Integer projectStaffs; 
    
    /**
     * 项目中完成的任务个数
     */
    private Integer projectFinish;
    
    /**
     * 项目中延误的任务个数
     */
    private Integer projectDelay;
    
    /**
     * 项目名称
     */
    private String projectName;
    
    /**
     * 实体类转禅道项目统计模型
     * @return
     */
    public ZtProjectStatistics creatProjectStatistics(){
    	ZtProjectStatistics p = new ZtProjectStatistics();
    	p.setId(project);
    	p.setName(projectName);
    	p.setStaffs(projectStaffs==null?0:projectStaffs);
    	p.setFinish(projectFinish==null?0:projectFinish);
    	p.setDelay(projectDelay==null?0:projectDelay);
    	return p;
    }

 
	
	 /**
	 * 实体转模型
	 * @return
	 */
	public ZtStatistics createStatustics() {
		ZtStatistics statistic = new ZtStatistics();
		
		if(zanTaoCountTask == null) {
			zanTaoCountTask = 0.0;
		}
		if(zanTaoDoneTask == null) {
			zanTaoDoneTask = 0.0;
		}
		if(zanTaoDelayTask == null) {
			zanTaoDelayTask = 0.0;
		}
		
		statistic.setUid(uid);
		statistic.setUname(uname);
		statistic.setEstimated(estimated);
		statistic.setDepletion(depletion);
		statistic.setFinishRate(finishRate);
		statistic.setDelayRate(delayRate);
		statistic.setCount(zanTaoCountTask);
		statistic.setDonecount(zanTaoDoneTask);
		statistic.setDelaycount(zanTaoDelayTask);
		statistic.setWorkload(workload);
		statistic.setDepletionRate(depletionRate);
		statistic.setPlumpness(plumpness);
		statistic.setFixed(fixed);
		
		return statistic;
	}
	
	public Double getFixed() {
		return fixed;
	}

	public void setFixed(Double fixed) {
		this.fixed = fixed;
	}

	public Long getTid() {
		return tid;
	}

	public void setTid(Long tid) {
		this.tid = tid;
	}

	public Integer getTaskNum() {
		return taskNum;
	}

	public void setTaskNum(Integer taskNum) {
		this.taskNum = taskNum;
	}

	public Integer getProject() {
		return project;
	}

	public void setProject(Integer project) {
		this.project = project;
	}

	public Double getZanTaoDoneTask() {
		if(zanTaoDoneTask!=null ){
			return zanTaoDoneTask;
		}
		return 0.0;
	}

	public void setZanTaoDoneTask(Double zanTaoDoneTask) {
		this.zanTaoDoneTask = zanTaoDoneTask;
	}

	public Double getZanTaoCountTask() {
		if(zanTaoCountTask!=null ){
			return zanTaoCountTask;
		}
		return 0.0;
	}

	public void setZanTaoCountTask(Double zanTaoCountTask) {
		this.zanTaoCountTask = zanTaoCountTask;
	}

	public Double getZanTaoDelayTask() {
		if(zanTaoDelayTask!=null ){
			return zanTaoDelayTask;
		}
		return 0.0;
		 
	}

	public void setZanTaoDelayTask(Double zanTaoDelayTask) {
		this.zanTaoDelayTask = zanTaoDelayTask;
	}

	public Double getEstimated() {
		if(estimated!=null && estimated!=0.0){
			return estimated;
		}
		return 0.0;
	}

	public void setEstimated(Double estimated) {
		this.estimated = estimated;
	}

	public Double getDepletion() {
		if(depletion!=null && depletion!=0.0){
			return depletion;
		}
		return 0.0;
	}

	public void setDepletion(Double depletion) {
		this.depletion = depletion;
	}

	public String getFinishRate() {
		return finishRate;
	}

	public void setFinishRate(String finishRate) {
		this.finishRate = finishRate;
	}

	public String getDelayRate() {
		return delayRate;
	}

	public void setDelayRate(String delayRate) {
		this.delayRate = delayRate;
	}

	public String getWorkload() {
		return workload;
	}

	public void setWorkload(String workload) {
		this.workload = workload;
	}

	public String getDepletionRate() {
		return depletionRate;
	}

	public void setDepletionRate(String depletionRate) {
		this.depletionRate = depletionRate;
	}

	public String getPlumpness() {
		return plumpness;
	}

	public void setPlumpness(String plumpness) {
		this.plumpness = plumpness;
	}

	public Integer getUid() {
		return uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public Integer getProjectStaffs() {
		return projectStaffs;
	}

	public void setProjectStaffs(Integer projectStaffs) {
		this.projectStaffs = projectStaffs;
	}

	public Integer getProjectFinish() {
		return projectFinish;
	}

	public void setProjectFinish(Integer projectFinish) {
		this.projectFinish = projectFinish;
	}

	public Integer getProjectDelay() {
		return projectDelay;
	}

	public void setProjectDelay(Integer projectDelay) {
		this.projectDelay = projectDelay;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	
 
	
}
